package model

import "gorm.io/gorm"

//购物车模型

type Cart struct {
	gorm.Model
	UserId      uint    `form:"user_id" json:"user_id" gorm:"type:int(11) not null;default:0;comment:用户表user主键id"`
	GoodsId     uint    `form:"goods_id" json:"goods_id" gorm:"type:int(11) not null;default:0;comment:商品表goods主键id"`
	BossId      uint    `form:"boss_id" json:"boss_id" gorm:"not null;default:0;comment:商家表boss主键id,0表示自营"`
	GoodsSc     string  `form:"goods_sc" json:"goods_sc" gorm:"type:varchar(120);comment:商品表goods商品货号"`
	GoodsName   string  `form:"goods_name" json:"goods_name" gorm:"type:varchar(255) not null;comment:商品表goods商品名"`
	MarkPrice   float64 `form:"mark_price" json:"mark_price" gorm:"type:decimal(10,2) not null;default:0.00;comment:商品表goods市场价"`
	ShopPrice   float64 `form:"shop_price" json:"shop_price" gorm:"type:decimal(10,2) not null;default:0.00;comment:商品表goods商店价"`
	MemberPrice float64 `form:"member_price" json:"member_price" gorm:"type:decimal(10,2) not null;default:0.00;comment:商品表goods会员折扣价"`
	ImgUrl      string  `form:"img_url" json:"img_url" gorm:"type:varchar(100) not null;comment:商品表goods商品封面图"`
	BuyNum      uint    `form:"buy_num" json:"buy_num" gorm:"not null;default:1;comment:购买的数量"`
	MaxNum      uint    `form:"max_num" json:"max_num" gorm:"not null;default:0;comment:购买数量的上限"`
	BarCode     string  `form:"bar_code" json:"bar_code" gorm:"type:varchar(100);comment:商品条形码"`
	Selected    string  `form:"selected" json:"selected" gorm:"not null;default:1;comment:购物车选中状态 1 选中 0 未选中"`
	PromType    uint    `form:"prom_type" json:"prom_type" gorm:"type:tinyint(1) not null;default:0;comment:订单类型0 普通订单,1 限时抢购, 2 团购 , 3 促销优惠"`
	PromId      uint    `form:"prom_id" json:"prom_id" gorm:" not null;default:0;comment:活动id"`
	Sku         string  `form:"sku" json:"sku" gorm:"type:varchar(255);comment:sku"`
	SpecKey     string  `form:"spec_key" json:"spec_key" gorm:"type:varchar(100);comment:商品规格key对应的spec_goods_price表"`
	SpecKeyName string  `form:"spec_key_name" json:"spec_key_name" gorm:"type:varchar(100);comment:商品规格组合名称"`
}
